package com.wy.powerbuilder.service.impl.ld;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wy.powerbuilder.entity.ld.Role;
import com.wy.powerbuilder.entity.ld.Sys_log;
import com.wy.powerbuilder.entity.ld.User;
import com.wy.powerbuilder.mapper.ld.LogMapper;
import com.wy.powerbuilder.service.ld.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceimpl implements LogService {
    @Autowired
    private LogMapper logMapper;
    @Override
    public Integer addLog(Sys_log sys_log) {
        return logMapper.addLog(sys_log);
    }

    @Override
    public PageInfo<Sys_log> pageAll(Integer pageNo,String logmin,String logmax,String name) {
        if(pageNo==null){
            pageNo=1;
        }
        PageHelper.startPage(pageNo,6);
        List<Sys_log> logs=logMapper.getAll(logmin,logmax,name);
        PageInfo<Sys_log> pageInfo=new PageInfo<>(logs);
        return pageInfo;
    }

}
